﻿using ActiveStoryTouch.DataModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace TestSuite.DataModel
{
    
    
    /// <summary>
    ///This is a test class for GestureTest and is intended
    ///to contain all GestureTest Unit Tests
    ///</summary>
    [TestClass()]
    public class GestureTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Gesture Constructor
        ///</summary>
        [TestMethod()]
        public void GestureConstructorTest()
        {
            String identifier = CommonTestConstants.TestGestureIdentifier;
            String displayName = "Lasso";
            String description = "The lasso gesture is commonly used for selecting elements";

            GestureManager gestureManager = new GestureManager();

            Gesture gesture = new Gesture { Identifier = identifier, DisplayName = displayName, Description = description };
            Assert.AreEqual<String>(identifier, gesture.Identifier);
            Assert.AreEqual<String>(displayName, gesture.DisplayName);
            Assert.AreEqual<String>(description, gesture.Description);

            gestureManager.Add(gesture.Identifier, gesture);

            Assert.AreEqual<int>(1, gestureManager.Count);
            Assert.AreEqual<String>(gestureManager[identifier].Identifier, gesture.Identifier);
            Assert.AreEqual<String>(gestureManager[identifier].DisplayName, gesture.DisplayName);
            Assert.AreEqual<String>(gestureManager[identifier].Description, gesture.Description);
        }
    }
}
